<?php

/**
 * @author Nick Swartelé
 */
require_once FILE_DB_SEARCH;

class Search {

    private $term = '';
    private $type = '';

    function __construct($term, $type) {

        $this->setTerm($term);
        $this->setType($type);
    }

    //Getters
    public function getTerm() {
        return $this->term;
    }

    public function getType() {
        return $this->type;
    }

    //Setters
    public function setTerm($term) {
        $this->term = $term;
    }

    public function setType($type) {
        $this->type = $type;
    }

    public function Search() {

        $search = new DbSearch($this->type, $this->term);
        $data_array = $search->DbSearch();

        if ($data_array == FALSE) {
//                echo "Geen resultaat gevonden!";
            return FALSE;
        } else {
            return $data_array;
        }
    }

}

?>
